<?php	require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('member');



/*

**************************

(C)2010-2015 phpMyWind.com

update: 2014-5-30 17:16:14

person: Feng

**************************

*/





//初始化参数

$tbname = '#@__user';
$tbname2 = '#@__manage';
$gourl  = 'member.php';

$time=time();
//引入操作类

require_once(ADMIN_INC.'/action.class.php');



//修改会员信息
if($action == 'update'){
	//更改 用户表中 级别
	$sql0 = "UPDATE `$tbname` SET level='3' where id=$id";
	$dosql->ExecNoneQuery($sql0);
	$sql = "UPDATE `$tbname2` SET  company='$company', truename='$truename' ,mobile='$mobile',address='$address',sheng='$live_prov',shi='$live_city',qu='$live_country',adcode='$live_country',checkinfo='$checkinfo',level='3' WHERE uid=$id";

	if($dosql->ExecNoneQuery($sql))
	{
		header("location:$gourl");
		exit();
	}

}




//修改会员信息
if($action == 'add'){
	//更改 用户表中 级别
	$sql0 = "UPDATE `$tbname` SET level='3' where id=$id";
	$dosql->ExecNoneQuery($sql0);
	//添加 服务站记录
	$sql = "INSERT INTO `$tbname2` (uid, openid, level, mobile, truename, company, sheng, shi, qu, address, adcode, regtime,checkinfo) VALUES ('$id', '$openid', '3', '$mobile', '$truename', '$company', '$live_prov', '$live_city', '$live_country', '$address', '$live_country', '$time','true')";

	if($dosql->ExecNoneQuery($sql))
	{
		header("location:$gourl");
		exit();

	}

}








//无条件返回

else

{

    header("location:$gourl");

	exit();

}

?>

